import request from '@/config/axios'
import signMd5Utils from '@/utils/signMd5Utils'
import type { responseType } from './type'

const signHeader = (url: string, params: any) => {
  const sign = signMd5Utils.getSign(url, params)
  return { 'X-Sign': sign, 'X-TIMESTAMP': signMd5Utils.getDateTimeToString() }
}

// 获取时间
export const getHttpTrace = (params: any): Promise<responseType> => {
  return request.get({
    url: '/actuator/httptrace',
    params,
    headers: signHeader('/actuator/httptrace', params)
  })
}
